from rest_framework import serializers
from question.models import Label
from user.models import User

# 个人中心使用简易版本的Label序列化器
class LabelSimpleSerializerView(serializers.ModelSerializer):


    class Meta:
        model = Label
        fields = ['id', 'label_name']

#个人中心极简版序列化器
class UserSimpleSeialiser(serializers.ModelSerializer):
    articles = LabelSimpleSerializerView(many=True)

    class Meta:
        model = User
        fields = ['id', 'username', 'avatar', 'articles', 'fans']